baoming_valid = function (path) {
    var text = device.getModel() + "-" +
        device.getBrand() + "-" +
        device.getScreenHeight() + "-" +
        device.getScreenWidth();
    var two = utils.dataMd5(text).substring(0, 16).toUpperCase();

    if (file.exists(path)) {
        var txt = file.readLine(path, 1);
        if (txt.split("BMA")[1] === two) {
            var url = "https://gitee.com/baishui0212/redbook/raw/master/baomingValid/" + txt;
            var data = http.httpGetDefault(url, 5 * 1000);
            if (data.toLowerCase().indexOf("ok") === -1) {
                toast("远程注册设备失败，请联系管理员");
                exit();
            } else {
                var array = data.split("#");
                if(array.length === 2){
                    var endTime = array[1];
                    if(endTime === ""){
                        toast("你没有续费... 拜拜啦~");
                        exit();
                    }
                    var nowTime = timeFormat("yyyyMMdd");
                    if (nowTime > endTime) {
                        var str = endTime + " 到期啦，你该续费啦...";
                        toast(str);
                        exit();
                    }
                }
            }
        } else {
            logd("bad gay! out");
            exit();
        }
    } else {
        logd("bad gay! out!");
        toast("远程注册设备失败，请联系管理员!!!");
        exit();
    }
};

baoming_valid("/sdcard/bmApp/other.txt");